#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>

#define BUF_SIZE 30

int main(int argc,char *argv[])
{
    int sock;
    char msg1[] = "Hi";
    char msg2[] = "I'm another UDP host!";
    char msg3[] = "Nice to meet you";

    struct sockaddr_in your_addr;
    socklen_t you_addr_size;

    sock = socket(AF_INET, SOCK_DGRAM, 0);
    memset(&your_addr, 0, sizeof(your_addr));
    your_addr.sin_family = PF_INET;
    your_addr.sin_addr.s_addr = inet_addr(argv[1]);
    your_addr.sin_port = htons((uint16_t)atoi(argv[2]));

    sendto(sock, msg1, strlen(msg1), 0, (const struct sockaddr *)&your_addr, sizeof(your_addr));
    sendto(sock, msg2, strlen(msg2), 0, (const struct sockaddr *)&your_addr, sizeof(your_addr));
    sendto(sock, msg3, strlen(msg3), 0, (const struct sockaddr *)&your_addr, sizeof(your_addr));

    close(sock);
    return 0;
}

